
import FetchHelper from "../helper/fetch-helper";

export default class JcdApi {
    static async list(params) {
        return [{
            jcdlx: "河道",
            geom: 'POINT(104.40270413354635 28.913750757102186)'
        }, {
            jcdlx: "雨情",
            geom: 'POINT(104.48063320529509 28.488391328793778)'
        }, {
            jcdlx: "水库",
            geom: 'POINT(105.03968977502578 28.769704726806637)'
        },
        
    ]
    }
    static async list1(jcdlx) {
        try {
            const resp = await FetchHelper.getJson(`/admin-api/ybyj/jcd/list`, {
                jcdlx:jcdlx
                
            })
            resp.rows = resp?.rows?.map(item => {

                if (item?.xq) {
                    try {
                        const json = JSON.parse(item?.xq);
                        return {
                            ...json,
                            ...item,
                        }
                    } catch (e) {

                    }
                }
                return item;
            })
            return resp;
        } catch (err) {
            return { rows: [] }
        }
    }
    static async yqjc_find(params){
        const resp=await FetchHelper.getJson(`/admin-api/ybyj/yqjc/list`,{...params})
        return resp;
    }
    static async hdjc_find(params){
        const resp=await FetchHelper.getJson(`/admin-api/ybyj/hdjc/list`,{...params})
        return resp;
    }
    static async skjc_find(params){
        const resp=await FetchHelper.getJson(`/admin-api/ybyj/skjc/list`,{...params})
        return resp
    }
    static async hljc_find(params){
        const resp=await FetchHelper.getJson(`/admin-api/ybyj/hljc/list`,{...params})
        return resp
    }
    static async lqkk_find(params){
        const resp=await FetchHelper.getJson(`/admin-api/ybyj/lqkkjcData/list`,{...params})
        return resp
    }
    static async gklwt_find(params){
        const resp=await FetchHelper.getJson(`/admin-api/ybyj/gklwtjcData/list`,{...params})
        return resp
    }


}